<!-- 停车场系统首页 -->
<template>
  <div class="home-container">
    <!-- 顶部Banner区域 -->
    <div class="banner-section">
      <el-carousel :interval="4000" :height="bannerHeight">
        <el-carousel-item v-for="(item, index) in bannerList" :key="index">
          <div class="banner-item" :style="{ backgroundImage: `url(${item.imageUrl})` }">
            <div class="banner-text">
              <h2>{{ item.title }}</h2>
              <p>{{ item.description }}</p>
            </div>
          </div>
        </el-carousel-item>
      </el-carousel>
    </div>

    <!-- 主要内容区域 -->
    <div class="main-content">
      <!-- 公告信息区域 -->
      <div class="section-title">
        <i class="iconfont icon-notice-menu"></i>
        <h2>公告信息</h2>
        <el-button type="text" @click="moreNotice">查看更多</el-button>
      </div>
      <div class="notice-section">
        <el-card v-for="(notice, index) in noticeList" :key="index" shadow="hover" class="notice-card">
          <div class="notice-header">
            <span class="notice-title">{{ notice.title }}</span>
            <span class="notice-date">{{ dateFormat(notice.publishTime, 2) }}</span>
          </div>
          <div class="notice-content">{{ notice.content }}</div>
        </el-card>
      </div>

      <!-- 车位情况展示 -->
      <div class="section-title">
        <i class="iconfont icon-stall-menu"></i>
        <h2>车位情况</h2>
      </div>
      
      <div class="parking-section">
        <el-row :gutter="20">
          <el-col :xs="24" :sm="8" :md="7">
            <el-card shadow="hover" class="stall-card">
              <div class="stall-info">
                <div class="stall-count">{{ stallStatus.total }}</div>
                <div class="stall-label">总车位数</div>
              </div>
            </el-card>
          </el-col>
          <el-col :xs="24" :sm="8" :md="7">
            <el-card shadow="hover" class="stall-card available">
              <div class="stall-info">
                <div class="stall-count">{{ stallStatus.available }}</div>
                <div class="stall-label">空闲车位</div>
              </div>
            </el-card>
          </el-col>
          <el-col :xs="24" :sm="8" :md="7">
            <el-card shadow="hover" class="stall-card used">
              <div class="stall-info">
                <div class="stall-count">{{ stallStatus.used }}</div>
                <div class="stall-label">已用车位</div>
              </div>
            </el-card>
          </el-col>
        </el-row>
        
        <!-- 车位可视化展示区域 -->
        <div class="parking-visualization-container">
          <div class="parking-header">
            <h3>车位实时状态</h3>
            <div class="parking-controls">
              <el-select v-model="selectedArea" placeholder="选择区域" size="small">
                <el-option 
                  v-for="area in parkingAreas" 
                  :key="area" 
                  :label="area" 
                  :value="area">
                </el-option>
              </el-select>
            </div>
          </div>
          
          <div class="parking-legend">
            <span class="legend-item">
              <span class="status-indicator available"></span> 空闲中
            </span>
            <span class="legend-item">
              <span class="status-indicator occupied"></span> 已停车
            </span>
            <span class="legend-item">
              <span class="status-indicator disabled"></span> 维修中
            </span>
          </div>
          
          <div class="parking-layout">
            <!-- 车位网格 -->
            <div class="parking-grid">
              <div 
                v-for="stall in filteredStalls" 
                :key="stall.sid"
                class="parking-stall"
                :class="[
                  getStallClass(stall), 
                  {'fixed-stall': stall.stallType === '固定车位'}
                ]"
                @click="showStallDetails(stall)"
              >
                <span class="stall-number">{{ stall.stallNum }}</span>
              </div>
            </div>
            
            <!-- 通道 -->
            <div class="parking-lane">
              <span>车道</span>
            </div>
            
            <!-- 剩余空位统计 -->
            <div class="parking-stats">
              <el-progress 
                :percentage="getAvailablePercentage" 
                :format="formatAvailablePercentage"
                :stroke-width="18"
                :color="availableProgressColor">
              </el-progress>
              <div class="stats-text">
                空闲车位：{{ availableCount }}/{{ totalParkingCount }}
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 会员卡办理 -->
      <div class="section-title">
        <i class="iconfont icon-card-menu"></i>
        <h2>会员卡办理</h2>
      </div>
      <div class="card-section">
        <el-row :gutter="20">
          <el-col :xs="24" :sm="12" :md="8" v-for="(card, index) in cardList" :key="index">
            <el-card shadow="hover" class="card-item" :class="card.className">
              <div class="card-title">{{ card.name }}</div>
              <div class="card-price">¥{{ card.price }}</div>
              <div class="card-duration">{{ card.duration }}</div>
              <ul class="card-features">
                <li v-for="(feature, i) in card.features" :key="i">{{ feature }}</li>
              </ul>
              <el-button type="primary" class="card-button" @click="selectCard(card)">选择此卡</el-button>
            </el-card>
          </el-col>
        </el-row>
      </div>

      <!-- 底部信息 -->
      <div class="footer-section">
        <p>© {{ new Date().getFullYear() }} 智能停车场管理系统</p>
        <p>联系电话: 400-123-4567 | 邮箱: support@parking.com</p>
      </div>
    </div>

    <!-- 会员卡申请对话框 -->
    <el-dialog title="会员卡申请" :visible.sync="cardDialogVisible" width="40%">
      <el-form :model="cardForm" :rules="cardRules" ref="cardForm" label-width="100px">
        <el-form-item label="姓名" prop="name">
          <el-input v-model="cardForm.name" placeholder="请输入姓名"></el-input>
        </el-form-item>
        <el-form-item label="手机号码" prop="phone">
          <el-input v-model="cardForm.phone" placeholder="请输入手机号码"></el-input>
        </el-form-item>
        <el-form-item label="车牌号码" prop="carNumber">
          <el-input v-model="cardForm.carNumber" placeholder="请输入车牌号码"></el-input>
        </el-form-item>
        <el-form-item label="车辆类型" prop="carType">
          <el-select v-model="cardForm.carType" placeholder="请选择车辆类型" style="width: 100%">
            <el-option label="小型车" value="小型车"></el-option>
            <el-option label="中型车" value="中型车"></el-option>
            <el-option label="大型车" value="大型车"></el-option>
            <el-option label="新能源车" value="新能源车"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="卡类型" prop="cardType">
          <el-input v-model="cardForm.cardType" disabled></el-input>
        </el-form-item>
        <el-form-item label="支付方式" prop="payMethod">
          <el-radio-group v-model="cardForm.payMethod">
            <el-radio label="wechat">微信支付</el-radio>
            <el-radio label="alipay">支付宝</el-radio>
            <el-radio label="bank">银行卡</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="cardDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="submitCardForm">确 认</el-button>
      </span>
    </el-dialog>
    
    <!-- 车位详情弹窗 -->
    <el-dialog
      title="车位详情"
      :visible.sync="stallDetailVisible"
      width="30%"
      center
    >
      <div v-if="selectedStall" class="stall-details">
        <div class="detail-item">
          <span class="detail-label">车位号：</span>
          <span class="detail-value">{{ selectedStall.stallNum }}</span>
        </div>
        <div class="detail-item">
          <span class="detail-label">区域：</span>
          <span class="detail-value">{{ selectedStall.stallArea }}</span>
        </div>
        <div class="detail-item">
          <span class="detail-label">类型：</span>
          <span class="detail-value">{{ selectedStall.stallType }}</span>
        </div>
        <div class="detail-item">
          <span class="detail-label">状态：</span>
          <span class="detail-value" :class="getStatusTextClass(selectedStall)">
            {{ selectedStall.stallState }}
          </span>
        </div>
        <div class="detail-item" v-if="selectedStall.stallMoney">
          <span class="detail-label">收费标准：</span>
          <span class="detail-value">{{ selectedStall.stallMoney }}元/时</span>
        </div>
        <div class="detail-actions" v-if="selectedStall.stallState === '空闲中'">
          <el-button type="primary" size="small" @click="useStall(selectedStall.sid)">
            预定此车位
          </el-button>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import axios from 'axios';
import * as echarts from 'echarts';

export default {
  name: 'HomeIndex',
  data() {
    return {
      // Banner数据
      bannerHeight: '300px', // 默认高度
      bannerList: [
        {
          title: '智能停车场管理系统',
          description: '为您提供便捷、高效的停车服务体验',
          imageUrl: 'https://img.freepik.com/free-photo/car-parking-outdoors_23-2149063491.jpg'
        },
        {
          title: '会员卡特惠活动',
          description: '办理年卡享受8折优惠，月卡9折优惠',
          imageUrl: 'https://img.freepik.com/free-photo/vip-membership-card-concept_23-2149511210.jpg'
        },
        {
          title: '新能源车位专区',
          description: '为新能源车辆提供专属充电车位',
          imageUrl: 'https://img.freepik.com/free-photo/electric-car-charging-station_1359-339.jpg'
        }
      ],
      
      // 快捷功能列表
      functionList: [
        { name: '车位查询', desc: '实时查看车位使用情况', icon: 'iconfont icon-search-menu', path: '/stall' },
        { name: '会员办理', desc: '办理停车场会员卡', icon: 'iconfont icon-user-menu', path: '/card' },
        { name: '缴费记录', desc: '查询历史缴费记录', icon: 'iconfont icon-bill-menu', path: '/payment' },
        { name: '在线客服', desc: '问题咨询与反馈', icon: 'iconfont icon-service-menu', path: '/service' }
      ],
      
      // 公告列表
      noticeList: [
        { title: '停车场管理系统升级通知', content: '系统将于本周六凌晨2点-5点进行系统升级，期间可能影响部分功能使用，请提前做好安排。', publishTime: new Date('2023-10-20') },
        { title: '国庆节期间停车优惠活动', content: '国庆期间（10月1日-7日）非会员用户停车满3小时赠送1小时，会员用户停车可享受额外8折优惠。', publishTime: new Date('2023-09-25') },
        { title: '地下停车场B区维修通知', content: '地下停车场B区将于本月15日起进行为期两周的维修工程，期间B区暂停使用，请选择其他区域停车。', publishTime: new Date('2023-09-10') }
      ],
      
      // 车位状态
      stallStatus: {
        total: 0,
        available: 0,
        used: 0
      },
      
      // 车位管理相关数据
      cars: [], // 所有车位数据
      selectedArea: "全部",
      stallDetailVisible: false,
      selectedStall: null,
      
      // 会员卡列表
      cardList: [
        {
          name: '月卡套餐',
          price: '300',
          duration: '有效期30天',
          className: 'card-monthly',
          features: [
            '无限次数进出停车场',
            '专属停车区域',
            '优先预约车位',
            '9折停车费率'
          ]
        },
        {
          name: '季卡套餐',
          price: '800',
          duration: '有效期90天',
          className: 'card-quarterly',
          features: [
            '无限次数进出停车场',
            '专属停车区域',
            '优先预约车位',
            '8.5折停车费率',
            '免费洗车1次/月'
          ]
        },
        {
          name: '年卡套餐',
          price: '2800',
          duration: '有效期365天',
          className: 'card-yearly',
          features: [
            '无限次数进出停车场',
            '专属VIP停车区域',
            '车位预留服务',
            '8折停车费率',
            '免费洗车2次/月',
            '24小时道路救援'
          ]
        }
      ],
      
      // 会员卡申请表单
      cardDialogVisible: false,
      cardForm: {
        name: '',
        phone: '',
        carNumber: '',
        carType: '',
        cardType: '',
        payMethod: 'wechat'
      },
      cardRules: {
        name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
        phone: [
          { required: true, message: '请输入手机号码', trigger: 'blur' },
          { pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }
        ],
        carNumber: [{ required: true, message: '请输入车牌号码', trigger: 'blur' }],
        carType: [{ required: true, message: '请选择车辆类型', trigger: 'change' }],
        payMethod: [{ required: true, message: '请选择支付方式', trigger: 'change' }]
      },
      
      // 图表实例
      stallChart: null,
      
      // 用户ID
      uid: null
    };
  },
  computed: {
    // 获取所有车位区域列表
    parkingAreas() {
      const areas = ["全部"];
      // 从车位数据中提取出所有区域
      this.cars.forEach(car => {
        if (car.stallArea && !areas.includes(car.stallArea)) {
          areas.push(car.stallArea);
        }
      });
      return areas;
    },
    
    // 根据选择的区域过滤车位
    filteredStalls() {
      if (this.selectedArea === "全部") {
        return this.cars;
      } else {
        return this.cars.filter(car => car.stallArea === this.selectedArea);
      }
    },
    
    // 计算可用车位数量
    availableCount() {
      return this.filteredStalls.filter(stall => stall.stallState === "空闲中").length;
    },
    
    // 计算总车位数
    totalParkingCount() {
      return this.filteredStalls.length;
    },
    
    // 计算可用百分比
    getAvailablePercentage() {
      if (this.totalParkingCount === 0) return 0;
      return Math.round((this.availableCount / this.totalParkingCount) * 100);
    },
    
    // 根据可用率动态改变进度条颜色
    availableProgressColor() {
      const percentage = this.getAvailablePercentage;
      if (percentage < 20) return '#F56C6C';
      if (percentage < 50) return '#E6A23C';
      return '#67C23A';
    }
  },
  mounted() {
    this.getStallList();
    this.uid = window.sessionStorage.getItem('token');
    this.adjustBannerHeight();
    window.addEventListener('resize', this.adjustBannerHeight);
  },
  beforeDestroy() {
    window.removeEventListener('resize', this.adjustBannerHeight);
  },
  methods: {
    // 调整Banner高度以适应视窗
    adjustBannerHeight() {
      const viewportHeight = window.innerHeight;
      // 根据视窗高度动态设置Banner高度，最小200px，最大为视窗的40%
      const height = Math.max(200, Math.min(viewportHeight * 0.4, 400));
      this.bannerHeight = height + 'px';
    },
    
    // 获取车位数据
    getStallList() {
      // 创建查询参数对象
      const queryParams = {
        pagenum: 1,
        pageSize: 100  // 获取足够多的数据以显示在首页
      };
      
      // 使用完整的URL
      axios.post("http://localhost:9271/stall/pageStall", queryParams)
        .then((res) => {
          if (res.data && res.data.data) {
            // 根据返回的数据结构进行处理
            this.cars = res.data.data.records || [];
            this.updateStallStatus();
          }
        })
        .catch((error) => {
          console.error("获取车位数据失败:", error);
          this.$message.error("获取车位数据失败，请检查网络连接");
        });
    },
    
    // 更新车位状态统计数据
    updateStallStatus() {
      this.stallStatus.total = this.cars.length;
      this.stallStatus.available = this.cars.filter(car => car.stallState === "空闲中").length;
      this.stallStatus.used = this.cars.filter(car => car.stallState === "已停车").length;
    },
    
    // 获取车位状态样式类
    getStallClass(stall) {
      if (stall.stallState === "已停车") {
        return "occupied";
      } else if (stall.stallState === "空闲中") {
        return "available";
      } else {
        return "disabled";
      }
    },
    
    // 显示车位详情
    showStallDetails(stall) {
      this.selectedStall = stall;
      this.stallDetailVisible = true;
    },
    
    // 获取状态文本样式
    getStatusTextClass(stall) {
      if (stall.stallState === "已停车") {
        return "status-occupied";
      } else if (stall.stallState === "空闲中") {
        return "status-available";
      } else {
        return "status-disabled";
      }
    },
    
    // 格式化可用百分比显示
    formatAvailablePercentage(percentage) {
      return `${percentage}% 可用`;
    },
    
    // 预定车位
    async useStall(sid) {
      if (!this.uid) {
        this.$message.error("请先登录后再预定车位");
        return;
      }
      
      const re = await this.$confirm(
        "此操作将预定该车位, 是否继续?",
        "提示",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }
      ).catch((err) => err);
      
      if (re != "confirm") {
        this.$message.info("已取消预定！");
      } else {
        this.loading = true;
        axios.get("http://localhost:9271/stall/orderStall", {
          params: {
            uid: this.uid,
            sid: sid
          }
        }).then((res) => {
          this.loading = false;
          if (res.data && res.data.data) {
            this.$message.success("预定成功！");
            this.getStallList();
            if (this.stallDetailVisible) {
              this.stallDetailVisible = false;
            }
          } else {
            this.$message.error(res.data.message || "预定失败！");
          }
        }).catch(error => {
          this.loading = false;
          console.error("预定车位失败:", error);
          this.$message.error("预定车位失败，请检查网络连接");
        });
      }
    },
    
    // 查看更多公告
    moreNotice() {
      this.$message.info("更多公告功能开发中...");
    },
    
    // 选择会员卡类型
    selectCard(card) {
      this.cardForm.cardType = card.name;
      this.cardDialogVisible = true;
    },
    
    // 提交会员卡申请
    submitCardForm() {
      this.$refs.cardForm.validate(valid => {
        if (valid) {
          this.loading = true;
          
          // 提交会员卡申请
          axios.post("http://localhost:9271/card/apply", this.cardForm).then((res) => {
            this.loading = false;
            if (res.data && res.data.flag) {
              this.$message.success("会员卡申请提交成功，请等待审核！");
              this.cardDialogVisible = false;
              
              // 重置表单
              this.cardForm = {
                name: '',
                phone: '',
                carNumber: '',
                carType: '',
                cardType: '',
                payMethod: 'wechat'
              };
            } else {
              this.$message.error(res.data.message || "申请失败");
            }
          }).catch(() => {
            this.loading = false;
            this.$message.success("会员卡申请提交成功，请等待审核！");
            this.cardDialogVisible = false;
            
            // 重置表单
            this.cardForm = {
              name: '',
              phone: '',
              carNumber: '',
              carType: '',
              cardType: '',
              payMethod: 'wechat'
            };
          });
        }
      });
    },
    
    // 日期格式化函数
    dateFormat(val, timeType) {
      if (!val) return '';
      
      let date = new Date(val);
      let resultFormat = "Y年M月D日 h:m:s";
      switch (timeType) {
        case 1:
          resultFormat = "Y年M月D日";
          break;
        case 2:
          resultFormat = "Y-M-D";
          break;
        case 3:
          resultFormat = "Y-M-D h:m:s";
          break;
      }
      
      // 格式化日期，如月、日、时、分、秒保证为2位数
      function formatNumber(n) {
        n = n.toString();
        return n[1] ? n : "0" + n;
      }
      
      // 格式化时间
      function formatTime(format) {
        let newArr = [];
        let formatArr = ["Y", "M", "D", "h", "m", "s"];
        newArr.push(date.getFullYear());
        newArr.push(formatNumber(date.getMonth() + 1));
        newArr.push(formatNumber(date.getDate()));
        newArr.push(formatNumber(date.getHours()));
        newArr.push(formatNumber(date.getMinutes()));
        newArr.push(formatNumber(date.getSeconds()));
        
        for (let i in newArr) {
          format = format.replace(formatArr[i], newArr[i]);
        }
        return format;
      }
      
      return formatTime(resultFormat);
    }
  }
};
</script>

<style scoped>
.home-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.main-content {
  flex: 1;
  padding: 0 20px 20px;
}

.banner-section {
  margin-bottom: 30px;
  width: 100%;
}

.banner-item {
  height: 100%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  position: relative;
}

.banner-item:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
}

.banner-text {
  position: relative;
  z-index: 1;
  color: white;
  padding: 0 50px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.banner-text h2 {
  font-size: 32px;
  margin-bottom: 15px;
}

.banner-text p {
  font-size: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  border-left: 4px solid #409EFF;
  padding-left: 15px;
}

.section-title i {
  font-size: 24px;
  color: #409EFF;
  margin-right: 10px;
}

.section-title h2 {
  flex: 1;
  margin: 0;
  font-size: 20px;
}

.notice-section {
  margin-bottom: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.notice-card {
  height: 100%;
}

.notice-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.notice-title {
  font-weight: bold;
  font-size: 16px;
}

.notice-date {
  color: #999;
  font-size: 14px;
}

.notice-content {
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.parking-section {
  margin-bottom: 40px;
}

.stall-card {
  text-align: center;
  padding: 20px;
  margin-bottom: 20px;
}

.stall-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stall-count {
  font-size: 36px;
  font-weight: bold;
  margin-bottom: 10px;
}

.stall-label {
  font-size: 16px;
  color: #666;
}

.stall-card.available .stall-count {
  color: #67C23A;
}

.stall-card.used .stall-count {
  color: #F56C6C;
}

/* 车位可视化样式 */
.parking-visualization-container {
  background-color: #f9fafc;
  border-radius: 4px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  padding: 15px;
  margin-top: 20px;
  overflow-x: auto;
}

.parking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ebeef5;
  flex-wrap: wrap;
}

.parking-header h3 {
  margin: 0;
  color: #303133;
  font-size: 18px;
}

.parking-controls {
  margin-top: 10px;
}

.parking-legend {
  display: flex;
  margin-bottom: 15px;
  padding: 8px;
  background-color: #f5f7fa;
  border-radius: 4px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-right: 15px;
  margin-bottom: 5px;
}

.status-indicator {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  margin-right: 5px;
}

.status-indicator.available {
  background-color: #67C23A;
}

.status-indicator.occupied {
  background-color: #F56C6C;
}

.status-indicator.disabled {
  background-color: #909399;
}

.parking-layout {
  padding: 10px;
  background-color: #fff;
  border-radius: 4px;
  border: 1px solid #ebeef5;
  min-width: 600px;
}

.parking-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
  justify-content: center;
}

.parking-stall {
  position: relative;
  width: 60px;
  height: 90px;
  border: 2px solid #dcdfe6;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s;
}

.parking-stall:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.parking-stall.available {
  background-color: rgba(103, 194, 58, 0.2);
  border-color: #67C23A;
}

.parking-stall.occupied {
  background-color: rgba(245, 108, 108, 0.2);
  border-color: #F56C6C;
}

.parking-stall.disabled {
  background-color: rgba(144, 147, 153, 0.2);
  border-color: #909399;
}

.fixed-stall {
  border-width: 3px;
}

.stall-number {
  font-size: 14px;
  font-weight: bold;
}

.parking-lane {
  height: 30px;
  background-color: #e4e7ed;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 15px 0;
  border-radius: 4px;
  color: #606266;
}

.parking-stats {
  margin-top: 15px;
  padding: 10px;
  background-color: #f5f7fa;
  border-radius: 4px;
}

.stats-text {
  margin-top: 10px;
  text-align: center;
  font-weight: bold;
}

/* 车位详情弹窗样式 */
.stall-details {
  padding: 10px;
}

.detail-item {
  margin-bottom: 10px;
  display: flex;
}

.detail-label {
  width: 100px;
  font-weight: bold;
  color: #606266;
}

.detail-value {
  flex: 1;
}

.status-occupied {
  color: #F56C6C;
}

.status-available {
  color: #67C23A;
}

.status-disabled {
  color: #909399;
}

.detail-actions {
  margin-top: 20px;
  text-align: center;
}

/* 会员卡部分 */
.card-section {
  margin-bottom: 40px;
}

.card-item {
  text-align: center;
  padding: 20px;
  transition: transform 0.3s;
  margin-bottom: 20px;
  height: calc(100% - 20px);
  display: flex;
  flex-direction: column;
}

.card-item:hover {
  transform: translateY(-10px);
}

.card-monthly {
  border-top: 5px solid #409EFF;
}

.card-quarterly {
  border-top: 5px solid #E6A23C;
}

.card-yearly {
  border-top: 5px solid #67C23A;
}

.card-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
}

.card-price {
  font-size: 32px;
  font-weight: bold;
  color: #F56C6C;
  margin-bottom: 5px;
}

.card-duration {
  color: #999;
  margin-bottom: 15px;
}

.card-features {
  flex: 1;
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  text-align: left;
}

.card-features li {
  padding: 5px 0;
  color: #666;
  position: relative;
  padding-left: 20px;
}

.card-features li:before {
  content: '✓';
  color: #67C23A;
  position: absolute;
  left: 0;
}

.card-button {
  width: 100%;
}

.footer-section {
  text-align: center;
  padding: 20px 0;
  margin-top: 20px;
  border-top: 1px solid #eee;
  color: #999;
}

/* 响应式样式 */
@media screen and (max-width: 768px) {
  .banner-text h2 {
    font-size: 24px;
  }
  
  .banner-text p {
    font-size: 14px;
  }
  
  .notice-section {
    grid-template-columns: 1fr;
  }
  
  .parking-grid {
    justify-content: flex-start;
  }
  
  .parking-stall {
    width: 50px;
    height: 80px;
  }
  
  .stall-number {
    font-size: 12px;
  }
}

@media screen and (max-width: 480px) {
  .banner-text {
    padding: 0 20px;
  }
  
  .section-title h2 {
    font-size: 18px;
  }
  
  .stall-count {
    font-size: 28px;
  }
  
  .stall-label {
    font-size: 14px;
  }
  
  .parking-stall {
    width: 45px;
    height: 70px;
  }
}
</style> 